﻿#ifndef MAT_H
#define MAT_H

#include <vector>

class Cell{
    public:
        explicit Cell();
        int val;
        int north, south, east, west;

};

class Mat
{
public:
    // 20 15,
    // 40 25,
    // 80 25
    static const int m = 40;
    static const int n = 25;


    int dx[4] = {0, 2, 0, -2};
    int dy[4] = {-2, 0, 2, 0};
    int mat_maxdept;
    int sr, sc;
    int er, ec;
    int totSteps;
    std::vector<std::pair<int, int> > path;
    std::vector<std::pair<int, int> > path_bfs;
    explicit Mat();
    ~Mat();

    bool vis[n][m];
    bool mark[n][m];
    Cell mat[n+5][m+5];
    void print();
    void dfs_find_path(int x, int y, int dept);
    void print_vis();
    bool dfs_dir_checker(int x, int y);
    bool isLegal(int x, int y);

    void waste_time();
    void preprocess();
    void print_grid();
    void print_line();
    bool checker();
    void generate();
    void init();
    void path_dfs(int x, int y);
    void bfs_path();
    void path_trace();

};

#endif // MAT_H
